﻿using System.Collections.Generic;
namespace PokerCards
{
    internal class CardHolder
    {
        private List<Card> theHand;

        internal CardHolder()
        {
            theHand = new List<Card>();
        }

        internal void Add(Card card)
        {
            theHand.Add(card);
        }
        internal void Clear()
        {
            theHand.Clear();
        }
        internal int Count()
        {
            return theHand.Count;
        }
        internal uint GetSuitHashCode()
        {
            System.Console.WriteLine("+GetSuitHashCode()");
            uint suit = 0;
            foreach (Card c in theHand)
                suit += (uint)c.suit;

            System.Console.WriteLine("-GetSuitHashCode({0})",suit);

            return suit;
        }
        internal ulong GetRankHashCode()
        {
            System.Console.WriteLine("+GetRankHashCode()");
            ulong rank = 0;
            foreach (Card c in theHand)
                rank += (ulong)c.rank;
            System.Console.WriteLine("-GetRankHashCode({0})", rank);
            return rank;
        }
        internal ulong GetUniqueRankHashCode()
        {
            System.Console.WriteLine("+GetUniqueRankHashCode()");
            ulong rank = 0;
            foreach (Card c in theHand)
                rank |= (ulong)c.rank;
            System.Console.WriteLine("-GetUniqueRankHashCode({0})", rank);
            return rank;
        }
    }
}
